//硬性工具
import Vue from 'vue'
import VueRouter from 'vue-router'

//商城项目
import EL_father_container from '../components/container/EL_father_container.vue'

// 商城左侧菜单组件
import BooK_index from '../components/booksystem/BooK_index.vue'
import BooK_article from '../components/booksystem/BooK_article.vue'
import BooK_author from '../components/booksystem/BooK_author.vue'
import BooK_avatar from '../components/booksystem/BooK_avatar.vue'
import BooK_category from '../components/booksystem/BooK_category.vue'
import BooK_publisher from '../components/booksystem/BooK_publisher.vue'
import BooK_system from '../components/booksystem/BooK_system.vue'
import BooK_user from '../components/booksystem/BooK_user.vue'



Vue.use(VueRouter)

let routes = [
    // 利用EL_father_container代替HelloWorld.vue
    {
        path: '',
        component: EL_father_container,
        children: [{
                path: '/index',
                //push的name就需要命名路由，我还是用原的path吧
                // name: 'namecp_product',
                component: BooK_index,
            },
            {
                path: '/article',
                component: BooK_article,
                children: [{
                    path: '/category',
                    component: BooK_category
                }, {
                    path: '/author',
                    component: BooK_author
                }, {
                    path: '/publisher',
                    component: BooK_publisher
                }]
            },
            {
                path: '/system',
                component: BooK_system,
                children: [{
                    path: '/system/user',
                    component: BooK_user,
                    children: [{
                        path: '/system/user/avatar',
                        component: BooK_avatar
                    }]
                }]
            }, {
                path: '/avatar',
                component: BooK_avatar
            }
        ]
    }
]

let router = new VueRouter({
    mode: 'history',
    routes: routes
})

export default router